/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mahumLogs.backedbeans;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *
 * @author Edouard
 */


@Entity
public class Machine implements Serializable {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int idMachine;
    
    private String ip;
    private String adresseMAC;
    private int numero;
    private String libelle;
    
    @ManyToOne(cascade = CascadeType.PERSIST)
    @JoinColumn(name = "FK_ETUDIANT")
    private Etudiant etudiant = new Etudiant();
    
    @ManyToOne(cascade = CascadeType.PERSIST)
    @JoinColumn(name = "FK_TYPEMACHINE")
    private TypeMachine typeMachine = new TypeMachine();

    /**
     * Constructeur vide
     */
    public Machine() {
        
    }
    
    /**
     * 
     * @return ip 
     */
    public String getIp() {
        return ip;
    }

    /**
     * 
     * @param ip 
     */
    public void setIp(String ip) {
        this.ip = ip;
    }
    
    /**
     * @return idMachine
     */
    public int getIdMachine() {
        return idMachine;
    }

    /**
     * @param idMachine 
     */
    public void setIdMachine(int idMachine) {
        this.idMachine = idMachine;
    }

    /**
     * @return adresseMac
     */
    public String getAdresseMAC() {
        return adresseMAC;
    }

    /**
     * @param adresseMAC 
     */
    public void setAdresseMAC(String adresseMAC) {
        this.adresseMAC = adresseMAC;
    }

    /**
     * @return Integer
     */
    public int getNumero() {
        return numero;
    }

    /**
     * @param numero 
     */
    public void setNumero(int numero) {
        this.numero = numero;
    }

    /**
     * @return libelle (String)
     */
    public String getLibelle() {
        return libelle;
    }

    /**
     * @param libelle 
     */
    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    /**
     * @return etudiant
     */
    public Etudiant getEtudiant() {
        return etudiant;
    }

    /**
     * @param etudiant 
     */
    public void setEtudiant(Etudiant etudiant) {
        this.etudiant = etudiant;
    }

    /**
     * @return typeMachine
     */
    public TypeMachine getTypeMachine() {
        return typeMachine;
    }

    /**
     * @param typeMachine 
     */
    public void setTypeMachine(TypeMachine typeMachine) {
        this.typeMachine = typeMachine;
    }   
}
